3.231 \(\int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+b x+c x^2}} \, dx\)

Optimal. Leaf size=241 \[ -\frac {\sqrt {a+b x+c x^2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac {\tanh ^{-1}\left (\frac {-2 a h+x (2 c g-b h)+b g}{2 \sqrt {a+b x+c x^2} \sqrt {a h^2-b g h+c g^2}}\right ) \left (h \left (2 a h (2 f g-e h)-b \left (-d h^2-e g h+3 f g^2\right )\right )+2 c \left (f g^3-d g h^2\right )\right )}{2 h^2 \left (a h^2-b g h+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2} \]

[Out]

-1/2*(2*c*(-d*g*h^2+f*g^3)+h*(2*a*h*(-e*h+2*f*g)-b*(-d*h^2-e*g*h+3*f*g^2)))*arctanh(1/2*(b*g-2*a*h+(-b*h+2*c*g
)*x)/(a*h^2-b*g*h+c*g^2)^(1/2)/(c*x^2+b*x+a)^(1/2))/h^2/(a*h^2-b*g*h+c*g^2)^(3/2)+f*arctanh(1/2*(2*c*x+b)/c^(1
/2)/(c*x^2+b*x+a)^(1/2))/h^2/c^(1/2)-(f*g^2-h*(-d*h+e*g))*(c*x^2+b*x+a)^(1/2)/h/(a*h^2-b*g*h+c*g^2)/(h*x+g)

________________________________________________________________________________________

Rubi [A]  time = 0.37, antiderivative size = 239, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {1650, 843, 621, 206, 724} \[ -\frac {\sqrt {a+b x+c x^2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac {\tanh ^{-1}\left (\frac {-2 a h+x (2 c g-b h)+b g}{2 \sqrt {a+b x+c x^2} \sqrt {a h^2-b g h+c g^2}}\right ) \left (2 c \left (f g^3-d g h^2\right )-h \left (-2 a h (2 f g-e h)-b h (d h+e g)+3 b f g^2\right )\right )}{2 h^2 \left (a h^2-b g h+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + b*x + c*x^2]),x]

[Out]

-(((f*g^2 - h*(e*g - d*h))*Sqrt[a + b*x + c*x^2])/(h*(c*g^2 - b*g*h + a*h^2)*(g + h*x))) + (f*ArcTanh[(b + 2*c
*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(Sqrt[c]*h^2) - ((2*c*(f*g^3 - d*g*h^2) - h*(3*b*f*g^2 - b*h*(e*g + d*
h) - 2*a*h*(2*f*g - e*h)))*ArcTanh[(b*g - 2*a*h + (2*c*g - b*h)*x)/(2*Sqrt[c*g^2 - b*g*h + a*h^2]*Sqrt[a + b*x
 + c*x^2])])/(2*h^2*(c*g^2 - b*g*h + a*h^2)^(3/2))

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rule 1650

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomia
lQuotient[Pq, d + e*x, x], R = PolynomialRemainder[Pq, d + e*x, x]}, Simp[(e*R*(d + e*x)^(m + 1)*(a + b*x + c*
x^2)^(p + 1))/((m + 1)*(c*d^2 - b*d*e + a*e^2)), x] + Dist[1/((m + 1)*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^
(m + 1)*(a + b*x + c*x^2)^p*ExpandToSum[(m + 1)*(c*d^2 - b*d*e + a*e^2)*Q + c*d*R*(m + 1) - b*e*R*(m + p + 2)
- c*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d, e, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&
 NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+b x+c x^2}} \, dx &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac {\int \frac {\frac {1}{2} \left (-2 c d g+b e g+2 a f g-\frac {b f g^2}{h}+b d h-2 a e h\right )+f \left (b g-\frac {c g^2}{h}-a h\right ) x}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{c g^2-b g h+a h^2}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \int \frac {1}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{2 h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {(2 f) \operatorname {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{h^2}+\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \operatorname {Subst}\left (\int \frac {1}{4 c g^2-4 b g h+4 a h^2-x^2} \, dx,x,\frac {-b g+2 a h-(2 c g-b h) x}{\sqrt {a+b x+c x^2}}\right )}{h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \tanh ^{-1}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{2 h^2 \left (c g^2-b g h+a h^2\right )^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.35, size = 227, normalized size = 0.94 \[ \frac {-\frac {h \sqrt {a+x (b+c x)} \left (h (d h-e g)+f g^2\right )}{(g+h x) \left (h (a h-b g)+c g^2\right )}+\frac {\tanh ^{-1}\left (\frac {2 a h-b g+b h x-2 c g x}{2 \sqrt {a+x (b+c x)} \sqrt {h (a h-b g)+c g^2}}\right ) \left (h \left (-2 a h (e h-2 f g)+b h (d h+e g)-3 b f g^2\right )+2 c \left (f g^3-d g h^2\right )\right )}{2 \left (h (a h-b g)+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+x (b+c x)}}\right )}{\sqrt {c}}}{h^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + b*x + c*x^2]),x]

[Out]

(-((h*(f*g^2 + h*(-(e*g) + d*h))*Sqrt[a + x*(b + c*x)])/((c*g^2 + h*(-(b*g) + a*h))*(g + h*x))) + (f*ArcTanh[(
b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + x*(b + c*x)])])/Sqrt[c] + ((2*c*(f*g^3 - d*g*h^2) + h*(-3*b*f*g^2 + b*h*(e*g +
d*h) - 2*a*h*(-2*f*g + e*h)))*ArcTanh[(-(b*g) + 2*a*h - 2*c*g*x + b*h*x)/(2*Sqrt[c*g^2 + h*(-(b*g) + a*h)]*Sqr
t[a + x*(b + c*x)])])/(2*(c*g^2 + h*(-(b*g) + a*h))^(3/2)))/h^2

________________________________________________________________________________________

fricas [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Check [ab
s(t_nostep)]Evaluation time: 0.71Error: Bad Argument Type

________________________________________________________________________________________

maple [B]  time = 0.02, size = 1671, normalized size = 6.93 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x)

[Out]

f/h^2*ln((c*x+1/2*b)/c^(1/2)+(c*x^2+b*x+a)^(1/2))/c^(1/2)-1/(a*h^2-b*g*h+c*g^2)/(x+g/h)*((x+g/h)^2*c+(b*h-2*c*
g)*(x+g/h)/h+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*d+1/h/(a*h^2-b*g*h+c*g^2)/(x+g/h)*((x+g/h)^2*c+(b*h-2*c*g)*(x+g/h)
/h+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*e*g-1/h^2/(a*h^2-b*g*h+c*g^2)/(x+g/h)*((x+g/h)^2*c+(b*h-2*c*g)*(x+g/h)/h+(a*
h^2-b*g*h+c*g^2)/h^2)^(1/2)*f*g^2+1/2/(a*h^2-b*g*h+c*g^2)/((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*ln(((b*h-2*c*g)*(x+g
/h)/h+2*(a*h^2-b*g*h+c*g^2)/h^2+2*((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*((x+g/h)^2*c+(b*h-2*c*g)*(x+g/h)/h+(a*h^2-b*
g*h+c*g^2)/h^2)^(1/2))/(x+g/h))*b*d-1/2/h/(a*h^2-b*g*h+c*g^2)/((a*h^2-b*g*h+c*g^2)/h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*h^2-b*g*h+c*g^2)/h^2)^(1/2))/(x+g/h))*c*g^3*f-1/h^2/((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*
ln(((b*h-2*c*g)*(x+g/h)/h+2*(a*h^2-b*g*h+c*g^2)/h^2+2*((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*((x+g/h)^2*c+(b*h-2*c*g)
*(x+g/h)/h+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2))/(x+g/h))*e+2/h^3/((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*ln(((b*h-2*c*g)*(x
+g/h)/h+2*(a*h^2-b*g*h+c*g^2)/h^2+2*((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*((x+g/h)^2*c+(b*h-2*c*g)*(x+g/h)/h+(a*h^2-
b*g*h+c*g^2)/h^2)^(1/2))/(x+g/h))*f*g

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume((b/h-(2*c*g)/h^2)^2>0)', see `
assume?` for more details)Is (b/h-(2*c*g)/h^2)^2    -(4*c       *((-(b*g)/h)        +(c*g^2)/h^2+a))     /h^2
zero or nonzero?

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {f\,x^2+e\,x+d}{{\left (g+h\,x\right )}^2\,\sqrt {c\,x^2+b\,x+a}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + b*x + c*x^2)^(1/2)),x)

[Out]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + b*x + c*x^2)^(1/2)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {d + e x + f x^{2}}{\left (g + h x\right )^{2} \sqrt {a + b x + c x^{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(h*x+g)**2/(c*x**2+b*x+a)**(1/2),x)

[Out]

Integral((d + e*x + f*x**2)/((g + h*x)**2*sqrt(a + b*x + c*x**2)), x)

________________________________________________________________________________________